import 'package:flutter/material.dart';

class WidgetWithPadding extends StatelessWidget {

  /**
   * padding margin是一个东西
   *
   * const 编译时确定
   */
  final Widget widget;
  final double l;
  final double t;
  final double r;
  final double b;

  WidgetWithPadding(this.widget, this.l, this.t, this.r, this.b) {}

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: EdgeInsets.fromLTRB(l, t, r, b),
      child: widget,
    );
  }
}